package com.example.controller;

import com.sxs.service.MinIoService;
import io.minio.errors.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import com.example.service.MinIoService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.io.IOException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;

/**
 * @author SongXuSheng
 * @description: MinIo接口
 * @date 2022/8/18 21:16
 */
@RestController
@RequestMapping("/minio")
public class MinIoController {
    @Resource
    private MinIoService minIoService;

    @GetMapping("getFileUrl")
    public String getFileUrl(){
        try {
            return minIoService.getFileUrl("material","202212291353498178_需求文档模板.docx");
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
